class SmartAirOutletAlarm {
  final String name; // 方舱名称
  final String cubicleNo; // 方舱编号
  final String deviceNo; // 设备编号
  final String label; // 标签
  final String address; // 地址
  final String dataType; // 数据类型
  final int status; // 0正常，1堵塞

  SmartAirOutletAlarm({
    required this.name,
    required this.cubicleNo,
    required this.deviceNo,
    required this.label,
    required this.address,
    required this.dataType,
    required this.status,
  });

  factory SmartAirOutletAlarm.fromJson(Map<String, dynamic> json) {
    return SmartAirOutletAlarm(
      name: json['name'] ?? '',
      cubicleNo: json['cubicleNo'] ?? '',
      deviceNo: json['deviceNo'] ?? '',
      label: json['label'] ?? '',
      address: json['address'] ?? '',
      dataType: json['dataType'] ?? '',
      status: json['status'] ?? 0,
    );
  }
}

class CubicleAirConditionerControlCabinetAlarm {
  final String name; // 方舱名称
  final String cubicleNo; // 方舱编号
  final String deviceNo; // 设备编号
  final String label; // 标签
  final String address; // 地址
  final String dataType; // 数据类型
  final String remark; // 备注
  final int status; // 1-正常，0触发

  CubicleAirConditionerControlCabinetAlarm({
    required this.name,
    required this.cubicleNo,
    required this.deviceNo,
    required this.label,
    required this.address,
    required this.dataType,
    required this.remark,
    required this.status,
  });

  factory CubicleAirConditionerControlCabinetAlarm.fromJson(Map<String, dynamic> json) {
    return CubicleAirConditionerControlCabinetAlarm(
      name: json['name'] ?? '',
      cubicleNo: json['cubicleNo'] ?? '',
      deviceNo: json['deviceNo'] ?? '',
      label: json['label'] ?? '',
      address: json['address'] ?? '',
      dataType: json['dataType'] ?? '',
      remark: json['remark'] ?? '',
      status: json['status'] ?? 1,
    );
  }
}

class AirConditionerAcquisitionAlarm {
  final String label; // 标签（触发位）
  final String address; // 地址
  final String alarmInfo; // 报警信息
  final String remark; // 备注
  final int status; // 0=正常，1=异常

  AirConditionerAcquisitionAlarm({
    required this.label,
    required this.address,
    required this.alarmInfo,
    required this.remark,
    required this.status,
  });

  factory AirConditionerAcquisitionAlarm.fromJson(Map<String, dynamic> json) {
    return AirConditionerAcquisitionAlarm(
      label: json['label'] ?? '',
      address: json['address'] ?? '',
      alarmInfo: json['alarmInfo'] ?? '',
      remark: json['remark'] ?? '',
      status: json['status'] ?? 0,
    );
  }
}

class AirSourceUnitAlarm {
  final String label; // 标签
  final String address; // 地址
  final String alarmInfo; // 报警信息
  final String remark; // 备注
  final int status; // 1=无故障,0=有故障 或 0=无故障,1=有故障

  AirSourceUnitAlarm({
    required this.label,
    required this.address,
    required this.alarmInfo,
    required this.remark,
    required this.status,
  });

  factory AirSourceUnitAlarm.fromJson(Map<String, dynamic> json) {
    return AirSourceUnitAlarm(
      label: json['label'] ?? '',
      address: json['address'] ?? '',
      alarmInfo: json['alarmInfo'] ?? '',
      remark: json['remark'] ?? '',
      status: json['status'] ?? 1,
    );
  }
}